
lst = [10, 20, 31, 34, 35, 56, 67, 78, 89, 99]

# 查找到值对应的位置
def i(lst, t, left, right):
    if left > right:
        return -1
    else:
        mid = (right+left)//2
        print(lst, left, right, mid)

        if t < lst[mid]:
            return i(lst, t, left, mid-1)
        elif t > lst[mid]:
            return i(lst, t, mid+1, right)
        else:
            return mid


print(i(lst, 8, 0, len(lst) - 1))